<?php
//CONFIGURAR LA CARPETA DONDE ESTAN LAS IMAGENES
$carpeta = '.';

if(!@include('./clases/tnimg.lib.php')) die('No se encontr&oacute; clase para generar im&aacute;genes');

if(isset($_GET['ancho']))
	$ancho = (int)$_GET['ancho'];
else $ancho = 0;
if(isset($_GET['alto']))
	$alto = (int)$_GET['alto'];
else $alto = 0;

if(isset($_GET['img'])){
  $ti = new ThumbnailImage ( );
  $ti->src_file = $carpeta.'/'.strip_tags($_GET['img']);
  $ti->dest_type = THUMB_JPEG;
  $ti->dest_file = STDOUT;
  $ti->max_width = $ancho;
  $ti->max_height = $alto;
  $ti->Output ( );
}
?>
